package com.sxt.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import com.sxt.dao.GoodsAttributeDao;
import com.sxt.domain.GoodsAttribute;
import com.sxt.model.EasyUIData;
import com.sxt.service.GoodsAttributeService;

@Service
public class GoodsAttributeServiceImpl implements GoodsAttributeService{

	@Autowired
	private GoodsAttributeDao dao;
	
	@Override
	public EasyUIData findAll(int page, int size) {
		PageRequest pageRequest = new PageRequest(page, size);
		Page<GoodsAttribute> goodsAtts = dao.findAll(pageRequest);
		return new EasyUIData(goodsAtts.getTotalElements(), goodsAtts.getContent());
	}

}
